/**
 * 
 */
Ext.define('app.view.user.UserModel', {

	extend: 'Ext.app.ViewModel',
	
	alias: 'viewmodel.user',
	
	stores: {
		userStore: {
			storeId: 'userStore',
			model: 'app.model.User',
			
			proxy: {
				type: 'ajax',
				url: 'rest/user/list',
				reader: {
					type: 'json',
					rootProperty: 'data',
					totalProperty: 'results'
				}
			},
			autoLoad: true
		},
		provinceStore: {
			storeId: 'provinceStore',
			fields: ['id','name'],
			proxy: {
				type: 'ajax',
				url: 'rest/system/province',
				reader: {
					type: 'json',
					rootProperty: 'data'
				}
			},
			autoLoad: false //在初始化窗口的时候加载数据
		},
		cityStore: {
			storeId: 'cityStore',
			fields: ['id','name'],
			proxy: {
				type: 'ajax',
				url: 'rest/system/city',
				reader: {
					type: 'json',
					rootProperty: 'data'
				}
			},
			autoLoad: false //在选择了省份之后由下拉框的change事件触发市的数据的加载
		},
		areaStore: {
			storeId: 'areaStore',
			fields: ['id','name'],
			proxy: {
				type: 'ajax',
				url: 'rest/system/district',
				reader: {
					type: 'json',
					rootProperty: 'data'
				}
			},
			autoLoad: false //在选择了市之后由下拉框的change事件触发区县的数据的加载
		}
	}
}) 